package org.example.demo2;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class HelloController {
    @CrossOrigin
    @PostMapping("/hello2")
    public List hello() {
        List list = new ArrayList();
        list.add("hello2");
        return list;
    }
    @GetMapping("/hi2")
    public Object hi() {
        return "hi2";
    }
}
